import request from '@/utils/request'

//查询主机列表
export function getList(query) {
    return request({
        url: '/databaseFaultInject/getAllDatabaseConnectInfo',
        method: 'get',
        params: query
    })
}

//查询IP
export function queryList(query) {
    return request({
        url: '/databaseFaultInject/getDatabaseConnectInfoByIp',
        method: 'get',
        params: query
    })
}

//新增、编辑数据
export function updateData(data) {
    return request({
        url: '/databaseFaultInject/addAndUpdateDatabaseConnect',
        method: 'post',
        data: data
    })
}

//删除
export function deleteRow(query) {
    return request({
        url: '/databaseFaultInject/deleteDatabaseConnect',
        method: 'get',
        params: query
    })
}

//连接测试
export function validate(data) {
    return request({
        url: '/databaseFaultInject/testDatabaseConnect',
        method: 'post',
        data: data
    })
}
